// Calculator.h
 
class Calculator {
public:
    Calculator();
    virtual ~Calculator(){}
    virtual int add(int a, int b);
    virtual int multiply(int a, int b);
};

Calculator::Calculator() {}


int Calculator::add(int a, int b) {
    return a + b;
}

int Calculator::multiply(int a, int b) {
    return a * b;
}


extern "C" {
    Calculator* createCalculator() {
        return new Calculator();
    }

    void deinitCalculator(Calculator* cal){
        delete cal;
    }
}